<template>
  <div class="examination">
    <el-tabs v-model="activeName" @tab-click="handleClick" >
      <el-tab-pane label="待审批" name="wait">
        <Wait ref="wait"></Wait>
      </el-tab-pane>
      <el-tab-pane label="已审批" name="complete">
        <Complete ref="complete"></Complete>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
    import Wait from '@/components/mail/approval/examination/wait'
    import Complete from '@/components/mail/approval/examination/complete'
    import {mapState} from 'vuex'
    export default {
        name: "index",
        components: {Wait, Complete},
        data() {
            return {
                activeName: 'wait'
            }
        },
        computed:{
            ...mapState(['common'])
        },
        created(){
            this.activeName = this.common.approvalExamState;
        },
        methods: {
            handleClick(tab, event) {
                this.$refs[tab.name].getList();
                this.$store.commit('SET_APPROVALEXAMSTATE',tab.name)
            }
        }
    }
</script>

<style scoped>

</style>
